package com.kkb.springcloudbill.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@TableName(value = "bill")
@Accessors(chain = true)//让setter方法返回对象自身
public class Bill {
    @TableId(value = "bill_id", type = IdType.AUTO)
    private Integer billId;

    @TableField(value = "title_")
    private String title;

    @TableField(value = "type_id")
    private Integer typeId;

    @TableField(value = "explain_")
    private String explanation;

    private double price;

    @TableField(value = "c_time")
//    @DateTimeFormat(pattern = "yyyy-HH-dd")
//    @JsonFormat(pattern= "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    @TableField(exist = false)
    private String typeName;

    @TableField(exist = false)
    private Date start;

    @TableField(exist = false)
    private Date end;

}
